home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 2001 January / CT_SW0101.ISO / pc / software / office / datenbk / valentin.sit / Valentina_PPC / more examples / Example for OpenForm / Create next >
Text File  |  1999-10-22  |  2KB  |  58 lines

  1.  
  2. Create()
  3. AddRecords()
  4.  
  5. ----------------------------------------------------------------------------
  6. on Create()
  7.     tell application "Valentina (PPC)"
  8.         set theDB to make new database with data file "GuestBook"
  9.         
  10.         tell theDB
  11.             set Customer to make new base object with properties {name:"Guests"} at end
  12.             
  13.             tell Customer
  14.                 make new field with properties {name:"Name", type:tString, length:30} at end
  15.                 make new field with properties {name:"Company", type:tString, length:50} at end
  16.                 make new field with properties {name:"Email", type:tString, length:20} at end
  17.                 make new field with properties {name:"Comment", type:tString, length:80} at end
  18.                 make new field with properties {name:"Number", type:tUlong} at end
  19.                 make new field with properties {name:"Letter", type:tText, block size:1024} at end
  20.             end tell
  21.             
  22.         end tell
  23.     end tell
  24. end Create
  25.  
  26.  
  27. ----------------------------------------------------------------------------
  28. --    Use Event Log window to see events end results.
  29. --
  30. on AddRecords()
  31.     
  32.     set theText to "Valentina is an extremely fast database engine for MacOS.
  33. (see benchmarks at <http://www.paradigmasoft.com> ).
  34.  
  35. Valentina is scriptable DBMS, which opens a power of 
  36. Valentina's engine to the Apple Script users.
  37.  
  38. Versions for PPC and 68K processors are available.
  39.  
  40. Until you register your copy the  modal dialog will
  41. appear on each database open."
  42.     
  43.     
  44.     tell application "Valentina (PPC)"
  45.         set DB to database "GuestBook"
  46.         set Guests to base object "Guests" of DB
  47.         
  48.         repeat with i from 1 to 5
  49.             make new record with data {"aaa", "bbb", "dDDD", "tttt", 45, theText} at end of Guests
  50.         end repeat
  51.         
  52.         close DB
  53.     end tell
  54. end AddRecords
  55.  
  56.  
  57.  
  58.